import request from '@/utils/request';

// 查询补偿单申请列表
export async function queryAuditTable(params) {
  //userId、type（列表类型）、startDate、endDate、!flightNo、!payType、!orderId、!currentPage、!numPerPage
  return request('/dp/sys/getOrderAuditInfo', {
    params,
  });
}
// 补偿单审核流程
export async function queryAuditProgress(params) {
  //orderId
  return request('/dp/sys/getOrderAuditRecord', {
    params,
  });
}

//补偿单详情
export async function queryAuditDetail (params) {
  //orderId
  return request('/dp/sys/getDetailOrderInfoByOrderId', {
    params
  })
}
// 详情页通过orderId获取taskId
export async function getTaskId (params) {
  return request('/dp/sys/getUserOrderTaskId', {
    params
  })
}
// 补偿单-旅客信息列表
export async function queryPassengerList (params) {
  //orderId
  return request('/dp/sys/getPaxInfoByOrderId', {
    params
  })
}

// 获取补偿次数表格数据
export async function getCompensationCount(params) {
  return request('/dp/sys/getPaxOrderInfo', {
    method: 'get',
    params,
  })
}
// 获取申领记录
export async function getApplyRecordInfo(params) {
  return request('/dp/sys/applyRecordInfo', {
    method: 'get',
    params,
  })
}
//补偿单-审核
export async function handleAudit (params) {
  //orderId、taskId、poinion、remark、auditor、processNode、handleUser（!)
  return request('/dp/sys/handleAudit', {
    method: 'post',
    data: {orderAuditInfo: params},
  })
}

//补偿单-获取部门
// 获取部门树的数据
export async function getTreeData(params) {
  return request(`/department/getDepartment/${params}`, {
    method: 'get'
  })
}

// 补偿单-获取审核人的节点
export function getAuditNode (params) {
  return request('/dp/sys/getAuditNode',{
    method: 'get',
    params
  })
}

// 根据用户名或工号查询用户
export async function getTreeUser (params) {
  console.log(params);
  return request('/user/retrieveUsers', {
    method: 'get',
    params
  })
}
// 获取审批人列表 /搜索 
export function getAuditPeople (params) {
  return request('/dp/sys/getAuditRoleUserInfo', {
    params
  })
}